package org.madao.gulimall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.madao.common.exception.NoStockException;
import org.madao.common.to.mq.SeckillOrderTo;
import org.madao.common.utils.PageUtils;
import org.madao.gulimall.order.entity.OrderEntity;
import org.madao.gulimall.order.vo.*;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author madao
 * @email 2051190945@qq.com
 * @date 2021-08-11 17:23:35
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 订单确认页，返回需要的数据
     * @return
     */
    OrderConfirmVo confirmOrder() throws ExecutionException, InterruptedException;

    SubmitOrderResponseVo submitOrder(OrderSubmitVo vo) throws NoStockException;

    OrderEntity getOrderByOrderSn(String orderSn);

    void closeOrder(OrderEntity entity);

    /**
     * 获取当前订单的支付信息
     * @param orderSn
     * @return
     */
    PayVo getOrderPay(String orderSn);

    PageUtils queryPageWithItem(Map<String, Object> params);

    String handlerPayResult(PayAsyncVo payAsyncVo);

    void createSeckillOrder(SeckillOrderTo orderTo);

}

